package demo;

public class Shape {
    public void are(int a) {
    }

    public static void main(String[] args) {
        Rect rect = new Rect();
        Cycle cycle = new Cycle();
        Shape[] shapes = {rect,cycle};
        for(Shape shape : shapes){
            shape.are(2);
        }
    }
}
class Rect extends Shape{
    @Override
    public void are(int a) {
    System.out.println(a*a);
    }
}
class Cycle extends Shape{
    @Override
    public void are(int a) {
    System.out.println(a*a*3.14);
    }
}